package com.h5ve.flow.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.h5ve.flow.mapper.WarmFlowMapper;
import com.h5ve.flow.service.ExecuteService;
import com.h5ve.flow.vo.FlowHisTaskVo;
import com.h5ve.flow.vo.FlowTaskVo;
import com.warm.flow.core.entity.HisTask;
import com.warm.flow.core.entity.Task;
import com.warm.flow.orm.entity.FlowTask;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author warm
 * @description: 流程执行serviceImpl
 * @date: 2023/5/29 13:09
 */
@Service
public class ExecuteServiceImpl implements ExecuteService {

    @Resource
    private WarmFlowMapper flowMapper;

    @Override
    public Page<FlowTaskVo> toDoPage(Page<FlowTaskVo> page, Task task) {
        return page.setRecords(flowMapper.toDoPage(task));
    }

    @Override
    public Page<FlowHisTaskVo> donePage(Page<FlowHisTaskVo> page,HisTask hisTask) {
        return page.setRecords(flowMapper.donePage(hisTask));
    }

    @Override
    public Page<FlowTaskVo> copyPage(Page<FlowTaskVo> page, FlowTask flowTask) {
        return page.setRecords(flowMapper.copyPage(flowTask));
    }
}
